<?php
	$where_cat = "";
	if(isset($_GET['var2']))
		$where_cat = " where titleurl = '".$_GET['var2']."' ";
	
	$re_cat = $db->select("select * from product_cat $where_cat  order by orderId asc, id asc limit 1 ");
	$tt_cat = $db->fetch($re_cat);
?>
<div class="w260 mr20">
	<div class="title fsize17"><?php echo ($_SESSION['lang'] == en)?'categories':'Danh mục' ?></div>	
	<ul class="pl-list">
		<?php
		$re_list = $db->select("select * from product_cat where level = 1 order by orderId asc");
		while($tt_list = $db->fetch($re_list))
		{
			if(($act=="product" || $act=="product-detail" ) && $tt_list['id'] == $tt_cat['id'])
				$subClass = "active";
			else 
				$subClass = "";
		?>
		<li class="<?= $subClass ?>">
			<a href="<?=APPLICATION_URL?>product/<?=$tt_list['titleurl']?>.html"><?=$tt_list['title'.$hg]?></a>
			<div class="clear"></div>
		</li>
		<?php
		}
		?>		
	</ul>
</div>
<?php			
	$where_item = " where idcat = '".$tt_cat['id']."' ";
	if(isset($_GET['var3']))	
		$where_item .= " and titleurl = '".$_GET['var3']."' ";
	
	$re_item = $db->select("select * from product_item $where_item  order by orderId asc, id asc limit 1 ");
	$tt_item = $db->fetch($re_item);
?>
<div class="w700">
	<div class="title"><?= $co_product['titlemenu'.$hg] ?></div>
	<div class="content-text product-detail-ctn">
		<div class="proimg">
			<img src="<?=APPLICATION_URL?>product-img/list/<?=$tt_item['image']?>" alt="">
		</div>
		<div class="title-desc">
			<h1 class="title"><?= $tt_item['title'.$hg] ?></h1>
			<div class="bg-price"><?= formatPrice($tt_item['price']) ?></div>
			<div class="desc">
				<?= $tt_item['description'.$hg] ?>
			</div>
		</div>
		<div class="clear"></div>	
		<?= $tt_item['content'] ?>
	</div>
</div>
